﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2016._12.Pr2
{
    class Program
    {
        static void Main(string[] args)
        {
            Employer firstPerson = new Employer();
            firstPerson.firstName = "Vasya";
            firstPerson.lastName = "Sidorov";
            firstPerson.cash = 100;
            Employer secondPerson = new Employer();
            secondPerson.firstName = "Valera";
            secondPerson.lastName = "Viktorov";
            secondPerson.cash = 250;
            Employer thirdPerson = new Employer();
            thirdPerson.firstName = "Vanya";
            thirdPerson.lastName = "Petrov";
            thirdPerson.cash = 300;
            Employer fourthPerson = new Employer();
            fourthPerson.firstName = "Anna";
            fourthPerson.lastName = "Ivanova";
            fourthPerson.cash = 200;
            Employer fifthPerson = new Employer();
            fifthPerson.firstName = "Katya";
            fifthPerson.lastName = "Raxkfi";
            fifthPerson.cash = 150;

            List<Employer> employerArray = new List<Employer> { };

            //Employer[] employerArray = new Employer[5];
            employerArray.Add(firstPerson);
            employerArray[1] = secondPerson;
            employerArray[2] = thirdPerson;
            employerArray[3] = fourthPerson;
            employerArray[4] = fifthPerson;

            int sumSalary = 0;
            for (int i = 0; i < 5; i++)
            {
                employerArray[i].Introduce();
                sumSalary += employerArray[i].cash;
            }
            Console.WriteLine("Сумма месячных зарплат {0}", sumSalary);
        }
    }

    
}
